#!/usr/bin/env node
const http=require("http");

  http.createServer((req,res)=>{
    console.log(req.method);
    switch(req.method){
      case 'GET':
        res.end('get method');
        break;

      case'POST':
        res.end('post');
        break;

      case'PUT':
        res.end('put');
        break;

      case'DELETE':
        res.end('delete');
        break;
      default:
        res.end(`${req.method}`);

    }
   res.writeHead( 200,{
      'Content-type':'text/html',
       'Content-length':Buffer.byteLength(html)});



}).listen(8080)
